package org.ztr.yanai.blog.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.ztr.yanai.blog.enums.UserRoleEnum;
import org.ztr.yanai.blog.enums.UserStatusEnum;

import java.time.LocalDateTime;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/22 10:00
 * @Description: 用户实体类
 * @Version: 1.0
 */
// 用户
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("user")
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private String username;
    
    @TableField("password_hash")
    private String passwordHash;
    
    private String email;
    private String avatar;
    
    private UserRoleEnum role;
    
    private UserStatusEnum status;
    
    @TableField("created_at")
    private LocalDateTime createdAt;
    
    @TableField("updated_at")
    private LocalDateTime updatedAt;
    
    @TableField("last_login")
    private LocalDateTime lastLogin;
    
    @TableLogic
    @TableField("is_deleted")
    private Boolean isDeleted;
}